package com.utsirc.irc;
import com.utsirc.irc.IRCService.LocalBinder;

import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;


public class IRCServiceConnection implements ServiceConnection {

	/**
	 * IRC service instance used by the activity to communicate to the service
	 * use a service so IRC worker doesn't get terminated prematurely
	 */
	public IRCService ircService;

	/**
	 * a boolean indicates whether the irc service is bounded to the application
	 */
	public static boolean isBound = false;

	@Override
	public void onServiceConnected(ComponentName className, IBinder service) {
		LocalBinder binder = (LocalBinder) service;
		ircService = binder.getService();
		isBound = true;
	}

	@Override
	public void onServiceDisconnected(ComponentName arg0) {
		isBound = false;
	}
}